home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8924 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: ingres.co.uk!usenet
  2. From: jonm@ingres.com (Jon Machtynger)
  3. Newsgroups: comp.lang.basic.visual.misc,comp.lang.c,comp.lang.c++,comp.os.ms-windows.programmer.controls,comp.os.ms-windows.programmer.misc
  4. Subject: Re: Multiple instances of a VBX
  5. Date: Tue, 27 Feb 1996 13:33:38 GMT
  6. Organization: Me!
  7. Message-ID: <4gv17p$lc8@zebedee.ingres.co.uk>
  8. References: <4g0efd$1mb@news.its.com>
  9. NNTP-Posting-Host: peacky.ingres.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. mastbrook@duff.com (Bill Mastbrook) wrote:
  13.  
  14.  
  15. >How do you differentiate between different instances of a VBX?
  16.  
  17. >When multiple instances of a control are created, the same HCTL value
  18. >is always passed to the main control procedure for all messages.  The
  19. >HCTL value is used to generate events with the VBFireEvent function.
  20. >So, without a unique HCTL value, how do I generate the events in the
  21. >correct instance of the control?  
  22.  
  23. This doesn't sound right.  You should be able to use a combination
  24. of the htcl and the hwnd to determine exactly which control and window
  25. you are using.  In other words, the htcl is a unique identifier.
  26.  
  27. >I have created a winsock VBX (with VC++ 1.5) and if multiple
  28. >applications using the VBX are opened, all events generated within the
  29. >VBX are passed to the last created instance.  
  30.  
  31. Don't forget that the VBX is shared by all controls using it.  In other words,
  32. if you have any variables declared globally, then all instances are going
  33. to use the info.  How are you referencing your hctl?
  34.  
  35. >Also, are there any good references for creating VBX's, OCX's, or
  36. >converting VBX's to OCX's?
  37.  
  38. See OLE Inside out by Mark Denning (I think).  I found it *very* confusing.
  39. I'm no expert at OLE and to be honest, it initially confused the hell out of me.
  40. I'll go back to it in a month or so when I gather enough guts...
  41.  
  42. Jon
  43.  
  44.  
  45.